import 'dart:ui';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:super_study_english_tool/model/model_user_album.dart';

class WidgetAlbum extends StatelessWidget {
  const WidgetAlbum({super.key, required this.album, required this.onView, required this.onDelete});

  final ModelUserAlbum album;

  final ValueChanged<int> onView;
  final ValueChanged<int> onDelete;

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: [
          Text(album.name!),
          Text("内容数量:${album.mediaQty}"),
          Text("完成数量:${album.finishQty}"),
          Text("总词汇量:${album.wordQty}"),
          Text("待复习句子:${album.reviewQty}"),
          Text("总句子数量:${album.sentenceQty!}"),
          Text("语速:${album.speed}"),
          ElevatedButton(
              onPressed: () {
                onView(album.id!);
              },
              child: Text("查看")),
          ElevatedButton(
              onPressed: () {
                onDelete(album.id!);
              },
              child: Text("删除"))
        ],
      ),
    );
  }
}
